package
{
	/**
	 *
	 *@author CrazyChen 
	 *2013-4-10
	 */	
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.events.MouseEvent;
	
	public class MouseTip extends Sprite
	{
		private var _stage:Stage;
		
		private var _cls:Class;
		
		private var bmp:Bitmap;
		public function MouseTip(s:Stage)
		{
			super();
			this.mouseChildren = false;
		    this.mouseEnabled = false;
			bmp = new Bitmap();
			this.addChild(bmp);
			_stage = s;
		}
		
		public function hide():void
		{
			if(this.parent){
			   this.parent.removeChild(this);	
			}
		}
		
		public function move():void{
			this.x = _stage.mouseX;
			this.y = _stage.mouseY;
		}

		public function get cls():Class
		{
			return _cls;
		}

		public function set cls(value:Class):void
		{
			_cls = value;
			if(cls){
				bmp.bitmapData = (new value()).bitmapData;
				bmp.width = bmp.height = 40;
				bmp.x = -bmp.width/2;
				bmp.y = -bmp.height/2;
			}
		}

			
	}
}